package ouyangye.person;

public class Robot implements Action {

    private double current;
    private String id;

    public Robot() {

    }

    public Robot(double current, String id) {
        this.current = current;
        this.id = id;
    }

    public double getCurrent() {
        return current;
    }
    public void setCurrent(double current) {
        this.current = current;
    }
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }


    @Override
    public void work() {
        System.out.println("机器人" + id + "电量为：" + current );
    }

    @Override
    public void eat() {
        System.out.println("机器人" + id + "正在充电");
    }

    @Override
    public void sleep() {
        System.out.println("机器人" + id + "休息");
    }

    @Override
    public void charge() {
        current = 100; // 充电后电流恢复满值
        System.out.println("机器人" + id + "充电完成，电流恢复至" + current);
    }


}